import gen
import alg
if __name__ == '__main__':

   num=int(input())
   datas=gen.generator(num)
   sol=alg.Solution()
   for i in range(num):
       res=sol.solveNQueens(datas[i])
       print(f'棋盘的边长为{datas[i]}')
       print(f'共有{len(res)}种解法')
       print(f'结果为：{res}')

